import time
from selenium.webdriver.common.by import By
from conn.comm import wait_element
# from conn.test import Win

class Loginpage():

    def __init__(self):
        self.we = wait_element()
        self.username = By.CSS_SELECTOR,"#txtUserName"
        self.password = By.CSS_SELECTOR,"#txtPassword"
        self.btn = By.CSS_SELECTOR,"#loginbtn"


    def login(self,driver,user,pwd):
        '''
        登录
        :param user:账号
        :param pwd: 密码
        :return:
        '''
        self.we.send_ele(self.we.look_wait(driver,*self.username),user)
        self.we.send_ele(self.we.look_wait(driver,*self.password),pwd)
        time.sleep(8)
        self.we.look_wait(driver,*self.btn).click()











